﻿using log4net;
using System;

namespace PrintService
{
    public class LogHelper
    {
        public static readonly ILog printInfo = log4net.LogManager.GetLogger("PrintLog");
        public static readonly ILog httpInfo = log4net.LogManager.GetLogger("HttpLog");

        public static void LogInfo(string message)
        {
            if (printInfo.IsInfoEnabled)
            {
                printInfo.Info(message);
            }
        }

        public static void LogHttpInfo(string message)
        {
            if (httpInfo.IsInfoEnabled)
            {
                httpInfo.Info(message);
            }
        }

        public static void LogError(string message)
        {
            if (printInfo.IsErrorEnabled)
            {
                printInfo.Error(message);
            }
        }

        public static void LogError(string message, Exception e)
        {
            if (printInfo.IsErrorEnabled)
            {
                printInfo.Error(message,e);
            }
        }

        public static void LogWarning(string message)
        {
            if (printInfo.IsWarnEnabled)
            {
                printInfo.Warn(message);
            }
        }
    }
}
